<project name="StockholmsStad.Utilities" default="Info">
  <include buildfile="Properties.Include" />

  <target name="Run">
    <call target="Info" />
    <call target="CopyConfigurationFiles" />
    <call target="CopyResourceFiles" />
    <call target="Build" />
  </target>

  <target name="Info">
    <echo message="${ProjectName} buildfile..." />
  </target>

  <target name="CopyConfigurationFiles">
    
    <copy todir="${ProjectSettingsFolder}" overwrite="true">
      <fileset basedir="${Global.ConfigFolder}\${ProjectSettingsName}" >
        <include name="**/Settings.Designer.cs" />
        <include name="**/Settings.settings" />
      </fileset>
    </copy>

    <copy todir="${WindowsServiceFolder}" overwrite="true">
      <fileset basedir="${Global.ConfigFolder}\${WindowsServiceName}" >
        <include name="**/*.config" />
      </fileset>
    </copy>
  </target>

  <target name="CopyResourceFiles">
    <copy todir="${WindowsServiceFolder}\Properties" overwrite="true">
      <fileset basedir="${Global.ConfigFolder}\${WindowsServiceName}" >
        <include name="**/Resources.*" />
      </fileset>
    </copy>
  </target>

  <target name="Build">
    <msbuild project="${ProjectFolder}.sln">
      <arg value="/p:Configuration=${Configuration}" />
      <arg value="/v:m" />
    </msbuild>
  </target>

</project>